package com.medical.literature.document.dto;

import lombok.Data;
import org.springframework.web.multipart.MultipartFile;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * 文献上传表单数据DTO
 * 专门用于处理multipart/form-data请求
 */
@Data
public class LiteratureUploadFormData {
    
    @NotNull(message = "文件不能为空")
    private MultipartFile file;
    
    @Size(max = 200, message = "文献标题长度不能超过200个字符")
    private String title;
    
    @Size(max = 500, message = "作者信息长度不能超过500个字符")
    private String authors;
    
    @Size(max = 2000, message = "摘要长度不能超过2000个字符")
    private String abstractText;
    
    @Size(max = 500, message = "关键词长度不能超过500个字符")
    private String keywords;
    
    @Size(max = 100, message = "期刊名称长度不能超过100个字符")
    private String journal;
    
    // 使用String类型避免日期转换问题
    private String publicationDate;
    
    @Size(max = 100, message = "DOI号长度不能超过100个字符")
    private String doi;
    
    // 手动添加getter/setter方法，确保Lombok注解生效
    public MultipartFile getFile() {
        return file;
    }
    
    public void setFile(MultipartFile file) {
        this.file = file;
    }
    
    public String getTitle() {
        return title;
    }
    
    public void setTitle(String title) {
        this.title = title;
    }
    
    public String getAuthors() {
        return authors;
    }
    
    public void setAuthors(String authors) {
        this.authors = authors;
    }
    
    public String getAbstractText() {
        return abstractText;
    }
    
    public void setAbstractText(String abstractText) {
        this.abstractText = abstractText;
    }
    
    public String getKeywords() {
        return keywords;
    }
    
    public void setKeywords(String keywords) {
        this.keywords = keywords;
    }
    
    public String getJournal() {
        return journal;
    }
    
    public void setJournal(String journal) {
        this.journal = journal;
    }
    
    public String getPublicationDate() {
        return publicationDate;
    }
    
    public void setPublicationDate(String publicationDate) {
        this.publicationDate = publicationDate;
    }
    
    public String getDoi() {
        return doi;
    }
    
    public void setDoi(String doi) {
        this.doi = doi;
    }
}